package pl.edu.pw.MidEmu.Sensing.Sensors;

/**
 * Helper class used by GUI to display sensors
 * 
 * @author Mateusz Starodab
 *
 */
public class DisplaySensor
{
	private ASensor sensor;

	/**
	 * Default constructor
	 * @param sensor Sensor whioch will be displayed
	 */
	public DisplaySensor(ASensor sensor)
	{
		this.sensor = sensor;
	}

	/**
	 * Returns sensor that is displayed
	 * @return Displayed sensor 
	 */
	public ASensor getSensor()
	{
		return sensor;
	}
	
	/**
	 * Sets sensor to be displayed
	 * @param sensor Sensor to be set
	 */
	public void setSensor(ASensor sensor)
	{
		this.sensor = sensor;
	}

	@Override
	/**
	 * Returns string representation of this sensor for use by GUI components 
	 * @return String representation of this Sensor
	 */
	public String toString()
	{
		return sensor.toString() + " - " + sensor.getValue().getValueAsText() + " - " + sensor.getStatusAsText();
	}
}
